package com.shxy.cloudclassroom.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shxy.cloudclassroom.entity.pojo.Assignment;
import com.shxy.cloudclassroom.entity.pojo.AssignmentSubmission;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.servlet.http.HttpSession;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import java.util.List;
import java.util.Map;

public interface AssignmentService extends IService<Assignment> {
    /**
     * 获取作业列表
     * @param assignmentPage 分页对象
     * @param wrapper 查询条件
     * @return 作业列表
     */
    List<Assignment> getAssignmentList(Page<Assignment> assignmentPage, LambdaQueryWrapper<Assignment> wrapper);

    /**
     * 发布作业
     * @param assignment 作业对象
     * @param file 附件文件
     * @param session 用户会话
     * @return 发布结果
     */
    Map<String, Object> publishAssignment(Assignment assignment, MultipartFile file, HttpSession session);

    /**
     * 提交作业
     * @param submission 作业提交对象
     * @param file 作业文件
     * @param session 用户会话
     * @return 提交结果
     */
    Map<String, Object> submitAssignment(AssignmentSubmission submission, MultipartFile file, HttpSession session);

    /**
     * 获取作业详情
     * @param id 作业ID
     * @param session 用户会话
     * @return 作业详情及相关信息
     */
    com.shxy.cloudclassroom.entity.vo.AssignmentDetailVO getAssignmentDetail(Integer id, HttpSession session);
}